package com.molihub.service.impl;

import com.molihub.entity.ArticleLike;
import com.molihub.service.ArticleLikeService;
import com.molihub.entity.User;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: ArticleLikeServiceImpl
 * @Description: TODO
 * @author: GGBOY
 * @date 2020/2/12 16:07
 * @Version: 1.0
 **/
@Service
public class ArticleLikeServiceImpl extends BaseService implements ArticleLikeService {
    @Override
    public Integer addLikeRecord(ArticleLike articleLike) {
        return articleLikeMapper.addLikeRecord(articleLike);
    }

    @Override
    public List<User> findLikeUsersByArticleId(Integer articleId) {
        return articleLikeMapper.findLikeUsersByArticleId(articleId);
    }

    @Override
    public Integer getLikeRecordByUserAndArticleId(Integer userId, Integer articleId) {
        return articleLikeMapper.getLikeRecordByUserAndArticleId(userId, articleId);
    }

    @Override
    public void deleteRecordByUserAndArticleId(Integer userId, Integer articleId) {
        articleLikeMapper.deleteRecordByUserAndArticleId(userId, articleId);
    }
}
